# -*- conding:utf-8 -*-
"""
@author:ym
@rewrite :06-2020/6/28-
不做维护！
"""
import requests
from future.backports.test.ssl_servers import threading



print('*************可爱多0.1抢课*****************')
print('')
# 作为全局变懒吧
cookie = input('输入cookie:\n')


def main():
    data = input('输入课程ID：')
    thread3 = threading.Thread(target=qiang, args=(data,))  # 想起来了，传参用的是元祖！
    thread3.start()


def qiang(data):
    print(data)
    url = 'http://jwgl.hutb.edu.cn/jsxsd/xsxkkc/bxxkOper?jx0404id='+str(data)
    header = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36',
        'Referer': 'http://172.30.1.70/srun_portal_pc.php?ac_id=1',
        'cookie': cookie
    }
    while True:
        mes = requests.get(url, headers=header, timeout=5)
        print(str(1)+str(mes.status_code)+':'+str(mes.text))


main()